package com.googlecode.jmicroerp.wicket.components.grid;

import java.io.Serializable;

/**
 *
 * @author Alexandru.Codescu
 */
public class ActionButton implements Serializable {
    private static final long serialVersionUID = 1L;
    private String label;
    private String insertLabel;
    private PageParameters pageParameters;
    private boolean canDisplay;
    
    public ActionButton(String label, PageParameters pageParameters, Boolean canDisplay) {
        this.label = label;
        this.pageParameters = pageParameters;
        this.canDisplay = canDisplay;
        this.insertLabel = "Adaugare";
    }
    
    public ActionButton(String label, PageParameters pageParameters) {
        this(label, pageParameters, true);
    }
    
    public ActionButton(PageParameters pageParameters, Boolean canDisplay) {
        this("modificare", pageParameters, canDisplay);
    }
    
    public ActionButton(PageParameters pageParameters) {
        this("modificare", pageParameters);
    }

    public ActionButton() {
        this.label = "dnd";
    }
    
    public String getLabel() {
        return label;
    }

    public void setLabel(String label) {
        this.label = label;
    }

    public PageParameters getPageParameters() {
        return pageParameters;
    }

    public void setPageParameters(PageParameters pageParameters) {
        this.pageParameters = pageParameters;
    }
    
    public boolean canDisplay(Long id) {
        return true;
    }
    
    public boolean canDisplay() {
        return canDisplay;
    }

    public String getInsertLabel() {
        return insertLabel;
    }

    public void setInsertLabel(String insertLabel) {
        this.insertLabel = insertLabel;
    }
    
    public void doAction(Long id) {
        // Override to add custom action
    }
}
